﻿
Public MustInherit Class clSer
    Protected _Vida As Decimal
    
    Protected _VidaRestante As Decimal
    Public Property VidaRestante As Decimal
        Get
            Return _VidaRestante
        End Get
        Set(ByVal value As Decimal)
            If value > _Vida Then
                _VidaRestante = Vida
            ElseIf value < 0 Then
                _VidaRestante = 0
            Else
                _VidaRestante = value
            End If
        End Set
    End Property
    
    Protected _Ataque As Decimal
    Protected _AtaqueActual As Decimal
    Protected _Defensa As Decimal
    Protected _Velocidad As Decimal
    Protected _Nombre As String
    Protected _DefensaActual As Decimal
    Protected _VelocidadActual As Decimal
    Protected _NombreActual As String
    Public Property AtaqueActual As Decimal
        Get
            Return _AtaqueActual
        End Get
        Set(ByVal value As Decimal)
            _AtaqueActual = value
        End Set
    End Property
    Public Property DefensaActual As Decimal
        Get
            Return _DefensaActual
        End Get
        Set(ByVal value As Decimal)
            _DefensaActual = value
        End Set
    End Property
    Public Property VelocidadActual As Decimal
        Get
            Return _VelocidadActual
        End Get
        Set(ByVal value As Decimal)
            _VelocidadActual = value
        End Set
    End Property
    Public Property NombreActual As Decimal
        Get
            Return _NombreActual
        End Get
        Set(ByVal value As Decimal)
            _NombreActual = value
        End Set
    End Property
    Public ReadOnly Property Nombre As String
        Get
            Return _Nombre
        End Get
    End Property
    Public ReadOnly Property Vida As Decimal
        Get
            Return _Vida
        End Get
    End Property
   
    Public ReadOnly Property Ataque As Decimal
        Get
            Return _Ataque
        End Get
    End Property
    Public ReadOnly Property Defensa As Decimal
        Get
            Return _Defensa
        End Get
    End Property
    Public ReadOnly Property Velocidad As Decimal
        Get
            Return _Velocidad
        End Get
    End Property

    Public ReadOnly Property Vivo As Boolean
        Get
            Return _VidaRestante > 0
        End Get
    End Property
    'Public Function CambiarAtaque(ByVal valor As Decimal) As Decimal 'TODO ¿Pero eto que e? INCOMPLETO
    '    Dim AtaqueFinal As Decimal = _Ataque + valor
    '    If AtaqueFinal < 0 Then Return 0
    '    Return AtaqueFinal
    'End Function
    'Public Function CambiarDefensa(ByVal valor As Decimal) As Decimal
    '    Dim DefensaFinal As Decimal = _Defensa + valor
    '    If DefensaFinal < 0 Then Return 0
    '    Return DefensaFinal
    'End Function
    'Public Function CambiarVelocidad(ByVal valor As Decimal) As Decimal 'TODO ARREGLAR
    '    Dim VelocidadFinal As Decimal = _Velocidad + valor
    '    If VelocidadFinal < 0 Then Return 0
    '    Return VelocidadFinal
    'End Function
    'Public Function CambiarVida(ByVal valor As Decimal) As Decimal
    '    Dim VidaFinal As Decimal = _Vida + valor
    '    If VidaFinal < 0 Then Return 0
    '    Return VidaFinal
    'End Function
    'Public Function CambiarManá(ByVal valor As Decimal) As Decimal
    '    Dim ManáFinal As Decimal = _Maná + valor
    '    If ManáFinal < 0 Then Return 0
    '    Return ManáFinal
    'End Function
    'Public Function CambiarDañoMágico(ByVal valor As Decimal) As Decimal
    '    Dim DañoMágicoFinal As Decimal = _DañoMágico + valor
    '    If DañoMágicoFinal < 0 Then Return 0
    '    Return DañoMágicoFinal
    'End Function
    'Public Function CambiarResistencia(ByVal valor As Decimal) As Decimal
    '    Dim ResistenciaFinal As Decimal = _Resistencia + valor
    '    If ResistenciaFinal < 0 Then Return 0
    '    Return ResistenciaFinal
    'End Function
    Public Sub RestaurarSer()
        AtaqueActual = Ataque
        DefensaActual = Defensa
        VelocidadActual = Velocidad
        NombreActual = Nombre
        'ResistenciaActual = Resistencia
        'DañoMagicoActual = DañoMágico
    End Sub
End Class
